﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using EYDIngenieria.ERP.ObjetosDeNegocio.Dominio;

public partial class impresiones_InventarioValorizado : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Inventario[] inventario = (Inventario[])Session["INVENTARIOVALORIZADO"];
        gdvInventario.DataSource = inventario;
        gdvInventario.DataBind();
        double valorTotal = 0;
        foreach (Inventario i in inventario)
        {
            valorTotal = valorTotal + (i.ValorUnitario * i.Saldo);
        }
        if (gdvInventario.Rows.Count > 0)
            ((Label)gdvInventario.FooterRow.FindControl("lblValorInventario")).Text = "$ " + valorTotal.ToString();
    }
}
